package com.siss.tenancy.util;

public class EmojiCharUtils {


    public static String transform(String chars){
        if (StringUtil.isEmpty(chars)){
            return chars;
        }
        StringBuilder emojiChars = new StringBuilder();
        int l = chars.length();
        for (int i = 0; i < l; i++) {
            char _s = chars.charAt(i);
            if (isNotEmojiCharacter(_s)) {
                emojiChars.append(_s);
            }
        }
        return emojiChars.toString();
    }
    public static boolean isNotEmojiCharacter(char codePoint) {
        return (codePoint == 0x0) ||
                (codePoint == 0x9) ||
                (codePoint == 0xA) ||
                (codePoint == 0xD) ||
                ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) ||
                ((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) ||
                ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF));
    }

}
